<template>
  <div class="upstreamDownstreamManagement">
    <van-sticky>
      <van-nav-bar
        :title="title"
        left-arrow
        @click-left=backMinePage
      >
        <template #right>
          <van-icon style="margin-right: 20px;" name="search" size="20"
                    @click="searchBoxShow = !searchBoxShow; toClearKeyWord(!!searchParams.keyword)"
          />
          <van-icon
            name="ellipsis"
            size="18"
            @click="showOverlay = true"
          />
        </template>
      </van-nav-bar>
      <van-search
        v-show="searchBoxShow"
        v-model="searchParams.keyword"
        placeholder="请输入企业名搜索"
        show-action
        shape="round"
        @search="onSearch"
        @clear="toClearKeyWord"
      >
        <div slot="action" @click="onSearch">搜索</div>
      </van-search>
    </van-sticky>
</div>
</template>

<script>
  import {navList_upDown} from "../recruitmentManagement/common/comConstant";
  import {Toast} from "vant";


  export default {
    name: 'blacklist',
    components: {

    },
    data(){
      return{
        showOverlay: false,
        title: '黑名单企业',
        navList: navList_upDown,
        // 检索参数
        searchParams: {
          keyword: '', // 搜索关键字
          pageIndex: 1, // 当前页
          pageSize: 10, // 每页显示条数
          audit: -1
        },
        searchBoxShow: false,
      }
    },
    methods:{
      onSearch() {
        this.searchParams.pageIndex = 1
        if(this.searchParams.keyword.trim()){
          // this._getJobList();
        } else {
          Toast('请先输入！');
        }
      },

      toClearKeyWord(isQuery = true){
        if(!isQuery){
          return null
        }
        this.searchParams.keyword = '';
        this.searchParams.pageIndex = 1
        this.$nextTick(() => {
          // this._getJobList()
        })
      },
      backMinePage(){
        localStorage.removeItem('tabItemIndex_myCompany');
        this.$router.push('/mine');
      },
    }
  }
</script>

<style scoped>

</style>
